#!/usr/bin/python
# -*- encoding: utf-8 -*-
'''
@File    :   1.py
@Time    :   2020/04/20 14:52:52
@Author  :   Malygos_l 
@Version :   1.0
@Contact :   751756061@qq.com
@WebSite :   www.gitee.com/malygos_l
'''
# 写一个程序，读取键盘输入的任意行文字信息，当输入空行时结束输入，将读入的字符串存于列表;然后将列表里面的内容写入到文件input.txt中；
# Start typing your code from here

print("please input txt:")
s = []
for line in iter(input, ''):
    s.append(line.replace(',',''))
# print(s)

try:
    with open("homework3\input.txt","w") as f:
        for a in s:
            f.write(a)
            f.write("\n")
except IOError:
    print("ERROR!")